﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace ThoiTrangT2B
{
    public partial class UCSlider : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadSlider();
            }
        }

        private void LoadSlider()
        {
            string sql = "SELECT * FROM dbo.tblT2BWebContent c WHERE c.MaDM = 'banner'";
            DataTable dt = SqlHelper.ExecuteDataTable(CommandType.Text, sql);
            string ImageSrc = "";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ImageSrc = dt.Rows[i]["NoiDung"].ToString();
                ltrSlider.Text += "<li><img src='" + ImageSrc + "' alt='' width='1032' height = '550'/></li>";
            }
        }
    }
}